<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<style>
    #app {
        border: 2px solid black;
        padding: 10px;
        margin-bottom: 400px;
    }

    .child {
        margin: 20px;
        padding: 10px;
        background-color: #cccccc;
        display: flex;

    }

    .nowarp {
        flex-flow: row nowrap;
    }

    .warp {
        flex-flow: row wrap;
    }

    .box {
        width: 100px;
        height: 50px;
        margin: 10px;
        background-color: aquamarine;
    }
</style>

<body>
    <div id="app">
        <h1>父组件范围</h1>
        <!-- 1、组件标签上的自定义属性，会作为数据变量传递给组件实例$attrs用于后续操作(props)
        2、组件标签上的w3c规范的属性，这些属性会作为标签属性传递个组件模板的根标签
              和根标签相同名称的属性进行合并 -->
        <child-one :itany="'网博'" class="nowarp"></child-one>
        <child-one :itany="'网博'" :class=" 'warp' "></child-one>
    </div>
    <template id="ChildOne">
        <div id="子组件根标签" class="child">
            <div class="box" v-for="(item, index) in 11" :key="index">{{item}}</div>
        </div>
    </template>
</body>
<script>
    Vue.component("ChildOne", {
        template: "#ChildOne"
    });
    new Vue({
        el: "#app"
    });
</script>

</html>